/* Add to your existing CSS */
.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0;
    transition: opacity 1s ease;
    overflow: hidden;
}

.header-bg.active {
    opacity: 1;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* Fallback image styling */
.fallback-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* Safari-specific styles */
@supports (-webkit-touch-callout: none) {
    .hero-video {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: -1;
    }

    /* Ensure fallback images work in Safari */
    .hero-video:not([playsinline]) {
        display: none;
    }

    .fallback-img {
        display: block;
    }
}

/* Add a background overlay for better text readability */
.header-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(0, 0, 0, 0.3) 50%,
            rgba(0, 0, 0, 0.1) 100%);
    z-index: -1;
}